home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
source
/
zendisk1
/
lst7-1.asm
< prev
next >
Wrap
Assembly Source File
|
1990-02-15
|
472b
|
20 lines
;
; *** Listing 7-1 ***
;
; Calculates the 16-bit sum of all bytes in a 64Kb block.
;
; Time with LZTIME.BAT, since this takes more than
; 54 ms to run.
;
call ZTimerOn
sub bx,bx ;we'll just sum the data segment
sub cx,cx ;count 64K bytes
mov ax,cx ;set initial sum to 0
mov dh,ah ;set DH to 0 for summing later
SumLoop:
mov dl,[bx] ;get this byte
add ax,dx ;add the byte to the sum
inc bx ;point to the next byte
loop SumLoop
call ZTimerOff